<%-- 
    Document   : MIDDLE
    Created on : Oct 30, 2012, 9:39:08 AM
    Author     : Suma
--%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<c:set var="tongtien" value="0"/>
<c:set var="soluongsanpham" value="0"/>

<c:if test="${sessionScope.GioHang.size()> 0}">

    <c:set var="tongtien" value="10000"/>

    <c:forEach var="sp" items="${sessionScope.GioHang}">
        <c:set var="soluongsanpham" value="${soluongsanpham+sp.getSoLuong()}"/>
        <c:set var="tongtien" value="${tongtien+sp.getSoLuong()*sp.getDonGia()}"/>
    </c:forEach>
</c:if>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
            <table class="tbborder">
                <tr align="center" valign="middle">
                    <td class="menu1" height="40" colspan="2">
                        <a href="GioHang.do">GIỎ HÀNG HIỆN TẠI</a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="5%" height="25">
                                    &nbsp;
                                </td>
                                <td width="95%" height="25">
                                    Số sản phẩm: <a style="color: #00F" href="GioHang.do">${soluongsanpham}</a>
                                </td>
                            </tr>
                            <tr>
                                <td width="5%" height="25">
                                    &nbsp;
                                </td>
                                <td width="95%" height="25">
                                    Tổng tiền: <a style="color: #00F" href="GioHang.do"> <fmt:formatNumber type="currency" value="${tongtien}" /></a>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <table class="tbborder">
                <tr align="center" valign="middle">
                    <td class="menu1" height="40" colspan="2">
                        SẢN PHẨM HOT
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                                <td width="10%" height="25">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>